package xin.mashibo.pattern.decorator;

/**
 * @author MaShibo
 * 日期 :  2019/1/24
 */
public class SideBorder extends Border {

    private char borderchar;

    public SideBorder(Display display, char borderchar) {
        super(display);
        this.borderchar = borderchar;
    }

    @Override
    public int getColumns() {
        return display.getColumns() + 2;
    }

    @Override
    public int getRows() {
        return display.getRows();
    }

    @Override
    public String getRowText(int row) {
        return borderchar + display.getRowText(row) + borderchar;
    }
}
